|
Foxit PDF SDK
|
Public 成员函数 | |
| def | TextPage (page, flags) |
| 从已解析的PDF页面构造函数。 更多... | |
| def | TextPage (other) |
| 用另一个文本页面对象的构造函数。 更多... | |
| def | GetBaselineRotation (rect_index) |
| 获取指定矩形的文本趋势(作为旋转)。 更多... | |
| def | GetCharCount () |
| 获取所有字符的数量。 更多... | |
| def | GetCharInfo (char_index) |
| 获取特定字符的字符信息。 更多... | |
| def | GetCharRange (rect) |
| 获取指定矩形区域内所有文本矩形的字符索引范围。 更多... | |
| def | GetChars (start, count) |
| 获取由起始索引和数量指定范围内的所有字符。 更多... | |
| def | GetIndexAtPos (x, y, tolerance) |
| 获取页面上指定位置处或附近的字符索引, 在中。 更多... | |
| def | GetText (flag) |
| 获取页面文本。 更多... | |
| def | GetTextInRect (rect) |
| 获取矩形内的文本,在中。 更多... | |
| def | GetTextRect (rect_index) |
| 通过索引获取文本矩形。 更多... | |
| def | GetTextRectArrayByRect (rect) |
| 获取指定矩形区域内所有文本矩形的数组。 更多... | |
| def | GetTextRectCount (start, count) |
| 计算由起始索引和数量指定范围内的文本矩形。 更多... | |
| def | GetTextUnderAnnot (annot) |
| 获取与指定注释相交的页面文本。 更多... | |
| def | GetWordAtPos (x, y, tolerance) |
| 获取页面上指定位置处或附近单词的字符范围, 在中。 更多... | |
| def | IsEmpty () |
| 检查当前对象是否为空。 更多... | |
静态 Public 属性 | |
| e_ParseTextNormal = _fsdk.TextPage_e_ParseTextNormal | |
| 通过根据字符在PDF页面中的位置规范化字符来解析PDF页面的文本内容。 | |
| e_ParseTextOutputHyphen = _fsdk.TextPage_e_ParseTextOutputHyphen | |
| 在换行时输出连字符来解析PDF页面的文本内容。 | |
| e_ParseTextUseStreamOrder = _fsdk.TextPage_e_ParseTextUseStreamOrder | |
| 按流顺序解析PDF页面的文本内容。 | |
| e_TextDisplayOrder = _fsdk.TextPage_e_TextDisplayOrder | |
| 如果设置,表示按显示顺序获取PDF页面的文本内容。 | |
| e_TextStreamOrder = _fsdk.TextPage_e_TextStreamOrder | |
| 如果设置,表示按流顺序获取PDF页面的文本内容。 | |
PDF文本页面表示PDF页面中的所有文本内容,根据为这些文本指定的解析标志。 类 TextPage 可用于检索PDF页面中文本的信息,例如单个字符、单个单词、 指定字符范围或矩形内的文本内容等。
此类对象还可用于构造其他文本相关类的对象,以便对文本内容进行更多操作 或从文本内容访问指定信息:
要在PDF页面的文本内容中搜索文本,请使用文本页面对象构造 TextSearch 对象。
要访问用作超文本链接的文本,请使用文本页面对象构造 PageTextLinks 对象。
| def FoxitPDFSDKPython2.TextPage.TextPage | ( | page, | |
| flags | |||
| ) |
从已解析的PDF页面构造函数。
| [in] | page | 有效的PDF页面对象。此页面应已被解析。 |
| [in] | flags | 文本页面的解析标志。请参考从 FoxitPDFSDKPython2.TextPage.e_ParseTextNormal 开始的值,这可以是这些值中的一个或组合。 |
| def FoxitPDFSDKPython2.TextPage.TextPage | ( | other | ) |
用另一个文本页面对象的构造函数。
| [in] | other | 另一个文本页面对象。 |
| def FoxitPDFSDKPython2.TextPage.GetBaselineRotation | ( | rect_index | ) |
获取指定矩形的文本趋势(作为旋转)。
| [in] | rect_index | 要检索的矩形的索引。 有效范围:从0到(count -1)。count 由函数 FoxitPDFSDKPython2.TextPage.GetTextRectCount 返回。 |
| def FoxitPDFSDKPython2.TextPage.GetCharCount | ( | ) |
获取所有字符的数量。
| def FoxitPDFSDKPython2.TextPage.GetCharInfo | ( | char_index | ) |
获取特定字符的字符信息。
| [in] | char_index | 字符的从零开始的索引。 范围:从0到(charcount - 1)。charcount 由函数 FoxitPDFSDKPython2.TextPage.GetCharCount 返回。 |
| def FoxitPDFSDKPython2.TextPage.GetCharRange | ( | rect | ) |
获取指定矩形区域内所有文本矩形的字符索引范围。
| [in] | rect | 矩形区域,在中。 |
| def FoxitPDFSDKPython2.TextPage.GetChars | ( | start, | |
| count | |||
| ) |
获取由起始索引和数量指定范围内的所有字符。
| [in] | start | 起始字符的索引,它是期望文本内容的第一个字符。 有效范围:从0到(charcount -1)。charcount 由函数 FoxitPDFSDKPython2.TextPage.GetCharCount 返回。默认值:0。 |
| [in] | count | 要检索的字符数量。-1表示获取从start_index到PDF页面末尾的 所有字符。特别地,当参数count 大于(charcount - start),将检索所有剩余字符 (从start_index开始)。charcount 由函数 FoxitPDFSDKPython2.TextPage.GetCharCount 返回。默认值:-1。 |
| def FoxitPDFSDKPython2.TextPage.GetIndexAtPos | ( | x, | |
| y, | |||
| tolerance | |||
| ) |
获取页面上指定位置处或附近的字符索引, 在中。
| [in] | x | x位置的值,在中。 |
| [in] | y | y位置的值,在中。 |
| [in] | tolerance | 字符命中检测的容差值,以点为单位。这不应为负数。 |
| def FoxitPDFSDKPython2.TextPage.GetText | ( | flag | ) |
获取页面文本。
| [in] | flag | 文本顺序标志,决定如何获取相关PDF页面的文本内容。请参考从 FoxitPDFSDKPython2.TextPage.e_TextStreamOrder 开始的值,这应该是这些值中的一个。 |
| def FoxitPDFSDKPython2.TextPage.GetTextInRect | ( | rect | ) |
获取矩形内的文本,在中。
| [in] | rect | 矩形区域,在中。 |
| def FoxitPDFSDKPython2.TextPage.GetTextRect | ( | rect_index | ) |
通过索引获取文本矩形。
| [in] | rect_index | 要检索的矩形的索引。 有效范围:从0到(count -1)。count 由函数 FoxitPDFSDKPython2.TextPage.GetTextRectCount 返回。 |
| def FoxitPDFSDKPython2.TextPage.GetTextRectArrayByRect | ( | rect | ) |
获取指定矩形区域内所有文本矩形的数组。
| [in] | rect | 矩形区域,在中。 |
| def FoxitPDFSDKPython2.TextPage.GetTextRectCount | ( | start, | |
| count | |||
| ) |
计算由起始索引和数量指定范围内的文本矩形。
| [in] | start | 字符索引范围中起始字符的索引。 有效范围:从0到(charcount -1)。charcount 由函数 FoxitPDFSDKPython2.TextPage.GetCharCount 返回。 |
| [in] | count | 字符索引范围中的字符数量。-1表示获取从start_index到PDF页面末尾的 所有字符。 |
| def FoxitPDFSDKPython2.TextPage.GetTextUnderAnnot | ( | annot | ) |
获取与指定注释相交的页面文本。
如果整个字符或字符的大部分与注释相交, 当前函数将检索此字符。
| [in] | annot | 注释。要检索与此注释相交的页面文本。 目前,仅支持文本标记注释 (高亮/下划线/删除线/波浪线注释);对于其他类型的注释, 此函数将抛出异常 FoxitPDFSDKPython2.e_ErrUnsupported 。 |
| def FoxitPDFSDKPython2.TextPage.GetWordAtPos | ( | x, | |
| y, | |||
| tolerance | |||
| ) |
获取页面上指定位置处或附近单词的字符范围, 在中。
目前,对于中文/日文/韩文,仅支持获取指定位置处或附近的单个字符。
| [in] | x | x位置的值,在中。 |
| [in] | y | y位置的值,在中。 |
| [in] | tolerance | 单词命中检测的容差值,以点为单位。这不应为负数。 |
| def FoxitPDFSDKPython2.TextPage.IsEmpty | ( | ) |
检查当前对象是否为空。
当前对象为空时,意味着当前对象无用。